﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace TimeReporter
{
    public partial class taskListView : UserControl
    {
        public taskListView()
        {
            InitializeComponent();

            // Set up the datagrid view
            this.dataGridView.ReadOnly = true;
            this.dataGridView.AutoGenerateColumns = false;

            int newColIndex = this.dataGridView.Columns.Add("ProjId", "Project");
            this.dataGridView.Columns[newColIndex].DataPropertyName = "Project";
            this.dataGridView.Columns[newColIndex].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;

            newColIndex = this.dataGridView.Columns.Add("UserId", "User");
            this.dataGridView.Columns[newColIndex].DataPropertyName = "UserId";

            newColIndex = this.dataGridView.Columns.Add("StartDate", "Action date");
            this.dataGridView.Columns[newColIndex].DataPropertyName = "StartDateTime";

            newColIndex = this.dataGridView.Columns.Add("Time", "Time spent");
            this.dataGridView.Columns[newColIndex].DataPropertyName = "TimeSpent";

            
        }

        public object DataSource
        {
            set { this.dataGridView.DataSource = value; }
        }

        
    }
}
